package chapter04.d4_dedug;

import java.util.Scanner;

public class MainTest {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] names = {"jack", "tony", "rose"};
        System.out.println("请输入要查询的名字");
        String inputName = scanner.next();
        boolean flag = false;
        for (int i = 0; i < names.length; i++) {
//            System.out.println(inputName);
//            System.out.println(names[i]);
//            System.out.println(inputName==names[i]);
            if(inputName.equals(names[i])){
                flag=true;
                break;
            }
        }
        if(flag){
            System.out.println("查询到此人信息");
        }else {
            System.out.println("查无此人");
        }
    }
}
